import { get } from "../../http";

// 列表筛选页数据
export const listFilter = (params) => {
	return get('/category/getCategoryList.json', params)
}

//详情页通过实体id和模块id获取基本信息 
export const getBasic = (params) => {
	return get(`${params.beanId}/${params.id}/get.json`)
}

// 详情页获取成员
/**
 * 
 * @param {Object} 查询条件 
 * @param {Boolean} 是否是成功模块 true： 是成果模块 
 */
export const getPerson = (params, isProduct) => {
	if (isProduct) {
		return get(`${params.beanId}-author/list.json`, {
			productId: params.id
		})
	}
	return get(`${params.beanId}-member/list.json`, {
		projectId: params.id
	})
}

// 详情页获取预算
export const getBudget = (params) => {
	return get(`${params.beanId}/getBudget.json`, {
		projectId: params.id
	})
}
// 详情页获取文档
export const getDocument = (params) => {
	return get(`${params.beanId}-document/list.json`, {
		projectId: params.id
	})
}

// 审核详情
export const getAuditDetail = (params) => {
	return get(`${params.beanId}/getWorkFlow.json`, {
		dataId: params.id
	})
}

// 审核详情
export const getCheckLog = (params) => {
	return get(`${params.beanId}/getCheckLogs.json`, {
		dataId: params.id
	})
}

// 审核操作
export const audit = (params) => {
	return get(`${params.beanId}/${params.id}/check.json`, 
	{
		checkType: params.checkType,
		checkInfo: params.checkInfo
	}
	)
}

// 审核详情
export const getList = (params) => {
	return get(`${params.beanId}/list.json`,params)
}

// 角色切换

export const doChangeRole = (params) => {
	return get('login/switchGroup.json', params)
}